package com.baizhi.service.impl;

import com.baizhi.dao.ExamDao;
import com.baizhi.entity.Exam;
import com.baizhi.service.ExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExamServiceImpl implements ExamService {

    @Autowired
    private ExamDao examDao;

    @Override
    public int selectTotal(String name) {
        return examDao.selectTotal(name);
    }

    @Override
    public List<Exam> selectDrugAndExamByPage(int page, int rows, String name) {
        if (name!=null&&"".equals(name)){
            name="%"+name+"%";
        }else {
            name=null;
        }
        int start=(page-1)*rows;
        int pageSize=rows;
        return examDao.selectDrugAndExamByPage(start,pageSize,name);
    }
}
